import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import {VirtualLoopData} from '../models/svgdata';

@Injectable({
  providedIn: 'root'
})
export class LoopdataService {

  constructor(private http: HttpClient) { }

  getLoopData(dataType: number = 1): Observable<VirtualLoopData> {
    const fileName = `data${dataType}.json`;
    return this.http.get<VirtualLoopData>(`assets/${fileName}`);
  }

}
